extends Node2D

@onready var color_rect: ColorRect = $CanvasLayer/Control/ColorRect


@onready var button: Button = $CanvasLayer/Control/Button
@onready var button_2: Button = $CanvasLayer/Control/Button2
@onready var label: Label = $CanvasLayer/Control/Label
@onready var label_2: Label = $CanvasLayer/Control/Label2
@onready var 按钮音效: AudioStreamPlayer = $按钮音效

signal start_game


#退出游戏按钮
func _on_button_2_button_down() -> void:
	按钮音效.play()
	get_tree().quit()


#开始游戏按钮
func _on_button_pressed() -> void:
	按钮音效.play()
	var tween =  create_tween()
	tween.tween_property(color_rect, "modulate:a" , 2., 1.2)
	button.visible = false
	button_2.visible = false
	label.visible = false
	label_2.visible = false
	await tween.finished
	start_game.emit()

func _ready() -> void:
	button.visible = true
	button_2.visible = true
	label.visible = true
	label_2.visible = true
